﻿using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

namespace Prism.Shell.ViewModels
{
    public class HeaderViewModel : BindableBase
    {
       

        private string getContentTime = string.Empty;

        public string GetContentTime
        {
            get { return getContentTime; }
            set
            {
                getContentTime = value;
                RaisePropertyChanged();
            }
        }

        private string keyword = string.Empty;

        public string Keyword
        {
            get { return getContentTime; }
            set
            {
                getContentTime = value;
                RaisePropertyChanged();
            }
        }

        public DelegateCommand GetContentCommand => new DelegateCommand(() =>
        {
            // System.Diagnostics.Process.Start("https://www.baidu.com");
            GetContentTime = DateTime.Now.ToString();
        });

        public DelegateCommand TextBlockMouseUpToCommand => new DelegateCommand(() =>
        {
            MessageBox.Show("你单击了我！！！");
        });

        public DelegateCommand<TextBlock> TextBlockParameterCommand => new DelegateCommand<TextBlock>((textBlock) =>
        {
            MessageBox.Show($"{textBlock.Text}");
        });

        public DelegateCommand SearchCommand => new DelegateCommand(() =>
        {
            MessageBox.Show($"您搜索的关键词：{Keyword}");
        });
    }
}
